﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NPOI.SS.Formula.Functions;
using Simple.Repository.Models.MorningCheck;

namespace Simple.Repository.Models.DeviceManagement
{
    /// <summary>
    /// 音响设备
    /// </summary>
    public class Device : BusinessFullEntityBase<Guid>
    {
        /// <summary>
        /// 设备名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 设备号/编号
        /// </summary>
        public string? Number { get; set; }

        /// <summary>
        /// 设备的ip地址
        /// </summary>
        public string? IpAddress { get; set; }

        /// <summary>
        /// 绑定班级
        /// </summary>
        public Guid? ClassesId { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public int DeviceType { get; set; } = (int)EnumDeviceType.sound;

        /// <summary>
        /// 设备序列号
        /// </summary>
        public string? DeviceKey { get; set; }

        /// <summary>
        /// 设备密码
        /// </summary>
        public string? DeviceSecret { get; set; }

        /// <summary>
        /// 适用人群（1：学生 2：老师 3：家长）
        /// </summary>
        public string? ApplicablePopulation { get; set; }

        /// <summary>
        /// 是否刷脸
        /// </summary>
        public bool? IsFace { get; set; }

        /// <summary>
        /// 是否刷卡
        /// </summary>
        public bool? IsCard { get; set; }

        /// <summary>
        /// 音响音量
        /// </summary>
        public int? Volume { get; set; }

        public override void ConfigureEntity(ModelBuilder builder)
        {
            builder.Entity<Device>(entity =>
            {
                entity.ToTable("Device");
            });
        }
    }
}
